import request from '@/utils/request'

export default {
    
    search(){   
        return request({  
            url: `/dept`,
            method: 'get'
        })
    },

    add(dept) {
        return request({
            url: `/dept`,
            method: 'post',
            data: dept
        })
    },

    getById(id) {
        return request({
            url: `/dept/${id}`,
            method: 'get'
        })
    },

    update(dept) {
        return request({
            url: `/dept/${dept.id}`,
            method: 'put',
            data: dept
        })
    },

    deleteById(id) {
        return request({
            url: `/dept/${id}`,
            method: 'delete'
        })
    }

}